import React from 'react'
import { TouchableOpacity, Linking } from 'react-native'
import styled from 'styled-components'

export default class MyTestScreen extends React.Component {
  render() {
    return (
      <Container>
        <TouchableOpacity
          onPress={() => {
            // 跳转外部链接(在浏览器中打开)
            // Linking.openURL(
            //   'http://news.cctv.com/2019/12/28/ARTIJfX9DIpZbHR4KqqXP0Ej191228.shtml'
            // )

            // 加载webview 在项目中打开
            this.props.navigation.push('Webview', {
              title: '关于我们',
              uri:
                'http://news.cctv.com/2019/12/28/ARTIJfX9DIpZbHR4KqqXP0Ej191228.shtml'
            })
          }}
        >
          <Text>关于我们</Text>
        </TouchableOpacity>

        <TouchableOpacity
          onPress={() => this.props.navigation.push('StaffBill')}
          // onPress={() => this.props.navigation.navigate('Home')}
        >
          <Text>员工账单</Text>
        </TouchableOpacity>
      </Container>
    )
  }
}

const Container = styled.View`
  flex: 1;
  justify-content: center;
  /* align-items: center; */
  padding: 30px;
`

const Text = styled.Text``
